using System;
using Andshev.OrmTools.Linq2Query.Enumerations;

namespace Andshev.OrmTools.Linq2Query.Attributes
{
    [AttributeUsage(AttributeTargets.Property, Inherited = true)]
    public class ColumnAttribute : Attribute
    {
        public ColumnType ColumnType { get; private set; }
        public string ColumnName { get; private set; }
        public bool Required { get; private set; }

        public ColumnAttribute(string columnName, bool required)
            : this(ColumnType.Default, columnName, required)
        {
        }

        public ColumnAttribute(ColumnType columnType, string columnName, bool required)
        {
            ColumnType = columnType;
            ColumnName = columnName;
            Required = required;
        }
    }
}